@extends('admin.layouts.main')
@section('header')
    @parent
    <style>
        .quoteBox{
            padding: 5px;
            margin-top: 10px;
        }
    </style>
@endsection
@section('content')
    <blockquote class="layui-elem-quote quoteBox">
        <form class="layui-form">

        </form>

    </blockquote>
    <div style="height: 100%">
        <table class="layui-hidden" id="treeTable" lay-filter="treeTable"></table>
    </div>
@endsection

@section('footer')
    @parent
    <script type="text/javascript">
        layui.config({
            base:'{{ asset('xman/extends') }}/'
        }).extend({
            //treetable: 'treetable-lay/treetable'
        }).use([ 'laytpl','table','form'],function () {
            var laytpl = layui.laytpl,
                table = layui.table,
                form = layui.form;
            var userId = getUrlParam('id');
            tableRender();
            function tableRender() {
                table.render({
                    elem:'#treeTable',
                    url: "{{ url('admin/admin/record') }}",
                    method: 'get',
                    where:{id:userId},
                    page:{
                        layout:['limit', 'count', 'prev', 'page', 'next', 'skip'],
                        groups: 5
                    },
                    limit: 20,
                    limits: [10, 20, 50, 100],
                    request:{
                        pageName: 'page',
                        limitName: 'pageSize'
                    },
                    response: {
                        statusName: 'status', //数据状态的字段名称，默认：code
                        statusCode: 200, //成功的状态码，默认：0
                        msgName: 'msg', //状态信息的字段名称，默认：msg
                        countName: 'totalCount', //数据总数的字段名称，默认：count
                        dataName: 'pages' //数据列表的字段名称，默认：data
                    },
                    cellMinWidth: 95,
                    height: "full-85",
                    id: "treeTable",
                    cols: [[
                        {field:'user_account',title:'账号',align:'center',width:150},
                        {field:'type',title:'类型',align:'center',width:100,templet:function (d) {
                                var type = '未知';
                                if(d.type == 1){
                                    type = '用户登陆';
                                }else if(d.type == 2){
                                    type = '管理员登陆';
                                }
                                return type;
                            }},
                        {field:'ip',title:'IP',align:'center',width:100},
                        {field:'address',title:'地址',align:'center',width:200},
                        {field:'login_time',title:'登陆时间',align:'center',width:200}
                    ]]
                })
            }



        })
    </script>
@endsection